﻿$(function () {
    var s = '';
    for (var i = 0; i < d.length; i++) {
        s += '<option value="' + d[i].id + '">' + d[i].name + '</option>';
    }
    $('#banks').html('<select id="bankid" style="width:160px;height:25px;border:1px solid #808080;padding:3px;">' + s + '</select>');
    if (bankid != 0) {
        $('#bankid').val(bankid);
    }
});
function save() {
    if ($('#bankaccountname').val() == '') {
        txttip('请填写姓名');
        return;
    }
    if ($('#bankaccount').val() == '') {
        txttip('请填写银行卡号');
        return;
    }
    if ($('#pass').val() == '') {
        txttip('请填写二次密码');
        return;
    }
    loading();
    $.post('/dos_m/bankinfo_save', { bankid: $('#bankid').val(), bankaccount: $('#bankaccount').val(), bankaccountname: $('#bankaccountname').val(), pass: $('#pass').val() }, function (d) { eval(d);  });
}
function err() {
    layer.closeAll();
    txttip('二次密码错误');
}
function ok() {
    layer.closeAll();
    txttip('保存成功', function () { location.href = '/my/sett'; });
}